package com.spzx.product.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.product.api.RemoteProductSkuService;
import com.spzx.product.api.domain.ProductSku;
import com.spzx.product.api.domain.DTO.SkuDTO;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class RemoteProductSkuServiceFallbackFactory implements FallbackFactory<RemoteProductSkuService> {
    @Override
    public RemoteProductSkuService create(Throwable cause) {
        return new RemoteProductSkuService() {
            @Override
            public R<List<ProductSku>> skuList(String s, SkuDTO skuDTO) {
                return R.fail("获取商品列表失败");
            }
        };
    }
}
